package com.yyy.dm.consumer.controller;

import com.yyy.dm.consumer.service.TradeConsumerService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletResponse;

@RestController
@RequestMapping("/pay")
public class TradeConsumerController {

    @Resource
    private TradeConsumerService tradeConsumerService;



    @GetMapping("/pay")
    public void pay(@RequestParam("orderNo") String orderNo, ServletResponse response) throws Exception{
        tradeConsumerService.pay(orderNo,response);
    }

    @RequestMapping("/demo")
    public void payCallBack(String orderNo, String trade_no, HttpServletResponse response) throws Exception{
        tradeConsumerService.payCallBack(orderNo,trade_no,response);
    }
}
